package com.cmsr.springclond.enu;

public enum PayTypeEnum {
    PAY_BALANCE("1",new PayEnumByBalance()),
    PAY_HUABEI("2",new PayEnumByHuabei()),
    PAY_YUEBAO("3",new PayEnumByYuEBAO());


    private String payType;
    private PayEnum payEnum;

    PayTypeEnum(String payType, PayEnum payEnum) {
        this.payEnum=payEnum;
        this.payType=payType;
    }

    public static PayEnum getPay(String payType){
        for(PayTypeEnum payTypeEnum:PayTypeEnum.values()){
            if(payTypeEnum.payType.equals(payType)){
                return payTypeEnum.payEnum;
            }
        }
        return new PayEnumByBalance();
    }

}
